﻿using System.Xml.Serialization;

namespace HamcoWcs.Models.TibcoMessage
{

    [XmlRoot("MESSAGE")]
    public class PalletLocationChangedReportMessage : BaseTibcoMessage<PalletLocationChangedReportMessageBody>
    {
        public PalletLocationChangedReportMessage()
        {

        }
        public PalletLocationChangedReportMessage(PalletLocationChangedReportMessageBody body, string inboxName = "", string listener = "") : base("PalletLocationChangedReport", body, inboxName, listener)
        {
        }
    }


    public class PalletLocationChangedReportMessageBody : PalletEventBase
    {
        public PalletLocationChangedReportMessageBody()
        {
        }

        public PalletLocationChangedReportMessageBody(string machineName, string portName, string palletName, string actionType, string currentPositionType = "PORT")
        {

            PortName = portName;
            PalletName = palletName;
            ActionType = actionType;
            CurrentMachineName = machineName;
            CurrentPositionType = currentPositionType;
            CurrentPositionName = portName;
            CurrentZoneName = "";
            EventUser = machineName;
        }


        [XmlElement("CURRENTMACHINENAME")]
        public string CurrentMachineName { get; set; }
        [XmlElement("CURRENTPOSITIONTYPE")]
        public string CurrentPositionType { get; set; }
        [XmlElement("CURRENTPOSITIONNAME")]
        public string CurrentPositionName { get; set; }
        [XmlElement("CURRENTZONENAME")]
        public string CurrentZoneName { get; set; }
        [XmlElement("ACTIONTYPE")]
        public string ActionType { get; set; }
    }
}
